﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using System.Data.SqlClient;

namespace Quanlybanhang
{
    public partial class Thongke_luutru : DevComponents.DotNetBar.Office2007Form
    {
        public Thongke_luutru()
        {
            InitializeComponent();
            khoitao();
        }

        public void khoitao()
        {
            //Lay danh sach nhung chu hang ban hang - kieu = 2
            string cmb_cmd = "select ngay, thang, nam, tenhang as 'Loại hàng', ten as 'Tên chủ hàng', soluong as 'Số lượng', tendonvi as 'Loại thùng', thanhtien as 'Thành tiền' from chuhang, luutru, loaihang, donvi where luutru.id_loaihang = loaihang.id and luutru.id_chuhang = chuhang.id and luutru.id_donvi = donvi.id";
            SqlDataAdapter sda = new SqlDataAdapter(cmb_cmd, MainForm.con);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            dataGridViewX1.DataSource = dt;
        }
    }
}
